<template>
	<view class="tp-bgf">
		<!-- 顶部背景图  S-->
		<view class="">
			<image class="bg-img" src="../static/destination/des-bg.png" mode=""></image>
			<view class="input-box">
				<input type="text" maxlength="10" disabled placeholder="请输入关键字" @click="pageJumps('/pages/others/homeSearch')" />
			</view>
		</view>
		<!-- 顶部背景图 E -->


		<!-- 交通 S -->
		<view class="traffic-box   tp-pd30  tp-bgf tp-pr tp-br20">
			<view class="level_align flex_between tp-ptb0lr40 tp-fc333 tp-fz24">
				<view class="column_align" v-for="(item, index) in trafficList" :key="index" @click="handleChooseTraffic(item)">
					<image class="tp-img88" :src="item.src" mode=""></image>
					<view class="tp-lh64">
						{{item.name}}
					</view>
				</view>
			</view>

		</view>
		<!-- 交通 E -->

		<!-- 推荐套餐 S -->
		<view class="recommend_package-wrap">
			<view class="common_tit-wrap tp-w690" @click="pageJumps('/pagesSecond/travel/travelHome')">
				<view class="l-wrap">旅游推荐</view>
				<view class="r-wrap">
					<text>查看更多</text>
					<image class="icon" src="../../static/imgs/icons/more-icon.png" mode="aspectFill"></image>
				</view>
			</view>
			<view class="recommend_package-content tp-w690">
				<view class="img-bg">
					<image src="../static/destination/tui-bg.png" mode="aspectFill"></image>
				</view>
				<view class="package_l-wrap" @click="pageJumps('/pagesSecond/travel/travelDetail')">
					<image class="img" :src="www+'imgs/snap/package1.png'" mode="aspectFill"></image>
					<view class="text-wrap">
						<text class="name ellispsis2">云南→西藏 7天 火车 景区 包门票</text>
						<view class="desc">
							<view class="price">￥ <text style="font-size: 34rpx;font-weight: bold;">8888</text>起</view>
							<text class="score">4.6分</text>
						</view>
					</view>
					<view class="common_dack-wrap" style="background-color: #FFAF3C;">交通+景区</view>
				</view>
				<view class="package_r-wrap tp-pr">
					<view class="li" @click="pageJumps('/pagesSecond/travel/travelDetail')">
						<view class="img">
							<image :src="www + 'imgs/snap/package2.png'" mode="aspectFill"></image>
						</view>
						<view class="txt">深圳→三亚</view>
						<view class="common_dack-wrap" style="background-color: #00B4FF;">交通+酒店</view>
					</view>
					<view class="li" @click="pageJumps('/pagesSecond/travel/travelDetail')">
						<view class="img">
							<image :src="www + 'imgs/snap/package2.png'" mode="widthFix"></image>
						</view>
						<view class="txt">深圳→三亚</view>
						<view class="common_dack-wrap" style="background-color: #12DCB8;">景区+酒店</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 推荐套餐 E -->

		<!-- 推荐景区 S -->
		<view class="tp-mt20">
			<!-- 标题块 S -->
			<view class="tp-bgf level_align flex_between tp-pr tp-ptb0lr30 tp-h88" @click="pageJumps('./evaluateMore')">
				<view class="level_align tp-fc333 tp-fz32 tp-fw600">
					<view class="tp-mr20 lan-line"></view>
					<text>推荐景区</text>
				</view>
				<view class="flex-1 level_align flex_end tp-fz24 tp-fc999">
					<view class="flex-1 tp-tr tp-mr15">
						<input type="text" disabled placeholder="查看更多" />
					</view>
					<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
				</view>
			</view>
			<!-- 标题块 E -->
			<view class="flex tp-ptb0lr20" style="padding-left: 30rpx;">
				<image class="tui-img tp-mr20" src="../static/destination/tuijian.png" mode=""></image>
				<view class="flex-1 level_align flex_between ">
					<view class="column_align tp-bgf tp-br12" @click="pageJumps('/pagesSecond/scenic/scenicDetail')" v-for="(item,index) in 2" :key="index">
						<image class="scenic-img" :src="www + 'imgs/snap/jq1.png'" mode=""></image>
						<view class="tp-pd20 tp-bbox tp-bs14" style="width: 280rpx;">
							<view class="ellispsis1 tp-fc333 tp-fz28">
								郑州少林寺郑州少林寺郑州少林寺郑州少林寺
							</view>
							<view class="level_align flex_between tp-fz26 ">
								<text class="tp-fc999">864人已买</text>
								<text class="tp-yellow">4.6分</text>
							</view>
						</view>

					</view>
				</view>
			</view>
		</view>
		<!-- 推荐景区 E -->

		<!-- 推荐酒店 S -->
		<view class="tp-mt20">
			<!-- 标题块 S -->
			<view class="tp-bgf level_align flex_between tp-pr tp-ptb0lr30 tp-h88" @click="pageJumps('./evaluateMore')">
				<view class="level_align tp-fc333 tp-fz32 tp-fw600">
					<view class="tp-mr20 lan-line"></view>
					<text>推荐酒店</text>
				</view>
				<view class="flex-1 level_align flex_end tp-fz24 tp-fc999">
					<view class="flex-1 tp-tr tp-mr15">
						<input type="text" disabled placeholder="查看更多" />
					</view>
					<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
				</view>
			</view>
			<!-- 标题块 E -->
			<view class="tp-ptb0lr30  level_align tp-bgf tp-mb20" @click="pageJumps('/pagesSecond/hotel/hotelDetail')" v-for="(item,index) in 3"
			 :key="index">
				<image class="hotel-img tp-br12 tp-mr20" src="https://lvyou.ysxcs.cn/profile/upload/2020/11/05/c7ce0af039588ec5592053048f72a4a9.png"
				 mode="aspectFill"></image>
				<view class="flex flex_column flex-1" style="height: 208rpx;">
					<view class="tp-fz28 tp-fc333 ellispsis1">
						郑州威尼斯人温泉大酒店郑州威尼斯人温泉大酒店郑州威尼斯人温泉大酒店
					</view>
					<view class="level_align flex_between tp-mt20">
						<text class="tp-yellow">五星级 | 4.6分</text>
						<text class="tp-fc999">距您42km</text>
					</view>
					<view class="level_align tp-mt20">
						<image class="tp-img28 tp-mr15" src="../../static/imgs/icons/address.png" mode=""></image>
						<text class="ellispsis1 flex-1">郑州大学科技园东区电厂路泾河路郑州大学科技园东区电厂路泾河路...</text>
					</view>
					<view class="level_align flex_between tp-mt20">
						<text class="ellispsis1 tp-fc tp-mr20">#景区周边、停车场、免费#景区周边、停车场、免费</text>
						<view class="tp-fz24 tp-red tp-fw600">
							￥<text class="tp-fz36">690</text>起
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 推荐酒店 E -->

		<!-- 大家说 S -->
		<view class="">
			<!-- 标题块 S -->
			<view class="tp-bgf level_align flex_between tp-pr tp-ptb0lr30 tp-h88" @click="pageJumps('./evaluateMore')">
				<view class="level_align tp-fc333 tp-fz32 tp-fw600">
					<view class="tp-mr20 lan-line"></view>
					<text>大家说</text>
				</view>
				<view class="flex-1 level_align flex_end tp-fz24 tp-fc999">
					<view class="flex-1 tp-tr tp-mr15">
						<input type="text" disabled placeholder="查看更多" />
					</view>
					<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
				</view>
			</view>
			<!-- 标题块 E -->
			<view class="tp-ptb0lr30">
				<view class="tp-bsf5 tp-pd20 tp-bs14 tp-bbox tp-br12 tp-mb20" v-for="(item,index) in 3" :key="index">
					<view class="">
						<text class="title tp-pr tp-fc333 tp-fz30 tp-fw600">郑州云台山景区</text>
					</view>
					<view class=" tp-bgf tp-mt20" >
						<!-- 头部信息栏 -->
						<view class="level_align flex_between">
							<view class="level_align flex-1 tp-mr20">
								<image class="tp-img64 tp-mr20 tp-br40" src="../static/scenic/personimg.png" mode=""></image>
								<view class="flex flex_column flex_between flex-1">
									<view class="tp-lh44 tp-fc333 tp-fz26 ellispsis1">
										我是一只喵呀~我是一只喵呀~我是一只喵呀~我是一只喵呀~
									</view>
									
								</view>
							</view>
							<view class="tp-lh40 tp-fc666">
								2020-06-12 14:12:33
							</view>
						</view>
						<!-- 内容 -->
						<view class="tp-mt20 tp-mt10">
							<view class="tp-fz26 tp-fc333 tp-lh44">
								乌镇景区好漂亮，还挺不错的行程 包接包送 安排的可以 导游也不错 很负责~
							</view>
							<view class="level_align tp-mt20 flex_wrap" v-if="index  == 0">
								<view class="tp-mb20" v-for="(urlItm, ind) in 10" :index="ind" :key="ind" @click="previewImg(item.image,urlItm)"
								 :style="{marginRight:(ind+1)%4 == 0 ?'0':'22rpx'}">
									<image class="say-imgs tp-br8" src="../static/scenic/fushi.png" mode="aspectFill"></image>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 大家说 E -->
		<view class="hover_btn" @click="pageJumps('/pages/tabbar/home', true)">
			<image src="../static/destination/home.png" mode=""></image>
		</view>
		<view class="tp-h98"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				trafficList: [{
						name: '专线班车',
						src: '../static/destination/ban.png',
						alias: 'bus'
					},
					{
						name: '拼车',
						src: '../static/destination/pin.png',
						alias: 'carpool'
					}, {
						name: '包车',
						src: '../static/destination/bao.png',
						alias: 'Chartered'
					},
					{
						name: '租车',
						src: '../static/destination/zu.png',
						alias: 'rent'
					}
				],
			};
		},
		methods: {
			// 点击交通
			handleChooseTraffic(item) {
				if (item.alias !== 'bus') {
					if (item.alias == 'carpool' || item.alias == 'Chartered') {
						this.$http.get(this.$api.trafficOpen).then(res => {
							if (res.code === 200) {
								if (item.alias == 'carpool') {
									if (res.data.pin == 0) {
										uni.navigateTo({
											url: '/pages/others/chooseTransportation?curTrafficinfo=' + JSON.stringify(item)
										});
									} else {
										uni.showToast({
											title: '拼车暂无开放',
											icon: 'none'
										})
									}
								}
								if (item.alias == 'Chartered') {
									if (res.data.bao == 0) {
										uni.navigateTo({
											url: '/pages/others/chooseTransportation?curTrafficinfo=' + JSON.stringify(item)
										});
									} else {
										uni.showToast({
											title: '包车暂无开放',
											icon: 'none'
										})
									}
								}
								this.$store.commit('upPinNumber', res.data.pinNumber)
							}
						})
					} else {
						uni.navigateTo({
							url: '/pages/others/chooseTransportation?curTrafficinfo=' + JSON.stringify(item)
						});
					}

				} else {
					uni.switchTab({
						url: '/pages/tabbar/home'
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bg-img {
		width: 750rpx;
		height: 494rpx;
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
	}

	.input-box {
		position: relative;
		width: 690rpx;
		margin: 0 auto;
		height: 56rpx;
		line-height: 56rpx;
		border-radius: 28rpx;
		color: #CCCCCC;
		background: rgba(255, 255, 255, .3) url(../../static/imgs/icons/search-icon.png) no-repeat left 238rpx center;
		background-size: 28rpx 28rpx;
		padding-left: 275rpx;
		box-sizing: border-box;

		.option {
			position: absolute;
			left: 30rpx;
			color: #333333;
		}
	}

	.traffic-box {
		margin-top: 400rpx;
	}

	.recommend_package-wrap {
		.common_tit-wrap {
			margin: 40rpx auto 30rpx;
		}

		.recommend_package-content {
			height: 428rpx;
			width: 690rpx;
			padding: 30rpx;
			box-sizing: border-box;
			border-radius: 12rpx;
			display: flex;
			justify-content: space-between;
			position: relative;
			// background: linear-gradient(58deg, #FD444A, #FD7237);

			.img-bg {
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				z-index: 1;
			}

			.package_l-wrap {
				width: 340rpx;
				height: 100%;
				border-radius: 12rpx;
				overflow: hidden;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				position: relative;
				z-index: 2;

				.img {
					height: 200rpx;
				}

				.text-wrap {
					flex: 1;
					background-color: #fff;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					padding: 20rpx 15rpx 30rpx;
					box-sizing: border-box;
					border-radius: 12rpx;
					overflow: hidden;
					position: absolute;
					left: 0;
					bottom: 0;
					z-index: 1;

					.name {
						font-size: 28rpx;
						font-weight: bold;
						margin-bottom: 30rpx;
					}

					.desc {
						display: flex;
						justify-content: space-between;
						align-items: flex-end;

						.price {
							font-size: 24rpx;
							color: #FF4A37;
						}

						.score {
							font-size: 26rpx;
							color: #FFAF3C;
						}
					}
				}
			}

			.package_r-wrap {
				width: 240rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				z-index: 2;

				.li {
					border-radius: 12rpx;
					overflow: hidden;
					position: relative;
					height: 166rpx;

					.img {
						height: 124rpx;
					}

					.txt {
						width: 100%;
						height: 66rpx;
						line-height: 66rpx;
						font-size: 28rpx;
						font-weight: bold;
						border-radius: 12rpx;
						overflow: hidden;
						background-color: #fff;
						padding: 0 22rpx;
						box-sizing: border-box;
						position: absolute;
						left: 0;
						bottom: 0;
						z-index: 1;
					}
				}
			}
		}
	}

	.tui-img {
		width: 104rpx;
		height: 320rpx;
	}

	.scenic-img {
		width: 280rpx;
		height: 210rpx;
		border-radius: 12rpx 12rpx 0px 0px;
	}

	.hotel-img {
		width: 248rpx;
		height: 208rpx;
	}

	.title {
		z-index: 20;

		&::after {
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			width: 100%;
			height: 8rpx;
			content: "";
			background: rgba(0, 180, 255, 1);
			border-radius: 4rpx;
			z-index: -1;
		}


	}
	.say-imgs{
		width: 146rpx;
		height: 130rpx;
	}
</style>
